%function Plot
clc;
clear all;
%------------------------------------------------------------------------------
% 参数设置
Add_step =640
Max_step = 3100;
Dt = 0.000977;
N = 512;
step =0;
%------------------------------------------------------------------------------

PI = 3.14159265358979323846;
k = 0;
kk = 1;
h = 2.0*PI/(N-1);
x = 0:h:2*PI;

matrix = load(sprintf('./1/Rho_%d.dat',step));
for j = 1:1:N
    for i = 1:1:N
        k = (j-1)*N+i;
        rho(i,j) = matrix(k,1);
    end 
end
plot(x,rho(N/2,:),'b');
hold on;
step = step+Add_step

matrix = load(sprintf('./1/Rho_%d.dat',step));
for j = 1:1:N
    for i = 1:1:N
        k = (j-1)*N+i;
        rho(i,j) = matrix(k,1);
    end 
end
plot(x,rho(N/2,:),'g');
hold on;
step = step+Add_step


matrix = load(sprintf('./1/Rho_%d.dat',step));
for j = 1:1:N
    for i = 1:1:N
        k = (j-1)*N+i;
        rho(i,j) = matrix(k,1);
    end 
end
plot(x,rho(N/2,:),'r');
hold on;
step = step+Add_step

matrix = load(sprintf('./1/Rho_%d.dat',step));
for j = 1:1:N
    for i = 1:1:N
        k = (j-1)*N+i;
        rho(i,j) = matrix(k,1);
    end 
end
plot(x,rho(N/2,:),'c');
hold on;
step = step+Add_step



matrix = load(sprintf('./1/Rho_%d.dat',step));
for j = 1:1:N
    for i = 1:1:N
        k = (j-1)*N+i;
        rho(i,j) = matrix(k,1);
    end 
end
plot(x,rho(N/2,:),'m');
hold on;
step = step+Add_step
xlabel('x');
ylabel('density'); 
axis([0 6.2 -1 6]);
